export default {
	namespaced: true,
	state: {
		userInfo: uni.getStorageSync('Flower')['userInfo'] || ''
	},
	mutations: {
		setStorage(state, userInfo) {
			state.userInfo = userInfo
			if (userInfo) {
				uni.setStorageSync('Flower', {
					userInfo
				})
			} else {
				uni.removeStorageSync('Flower')
			}

		},
		updateUserInfo(state, userInfo) {
			state.userInfo = userInfo
			let Flower = uni.getStorageSync('Flower')
			Flower.userInfo = userInfo
			uni.setStorageSync('Flower', Flower)
		}
	}
}
